<% elist = Entry.find(:all) %>
<% if params[:query] != ""%>
  <% if searchresults2.length == 0 %>
    <% if searchresults.length == 0 %>
      <% if params[:query] != "meebo" %>
        <% if params[:query] != "unhub" %>
	        <p>Sorry! No articles found...</p>
          <hr>
        <% end %>
      <% end %>
    <% end %>
  <% end %>
<% end %>
<% if params[:query] == "meebo" %>
    <p><!-- Beginning of meebo me widget code. Want to talk with visitors on your page? Go to http://www.meebome.com/ and get your widget! --> <object width="150" height="300" ><param name="movie" value="http://widget.meebo.com/mm.swf?rOPQHPbzDF"/><embed src="http://widget.meebo.com/mm.swf?rOPQHPbzDF" type="application/x-shockwave-flash" width="150" height="300"></embed></object>
    </p>
    <hr>
<% end %>

<% if params[:query] == "unhub" %>
    <p>
    <iframe src ="http://www.unhub.com/dreichbach" width="500" height="500">
  <p>Your browser does not support iframes.</p>
    </iframe>
    </p>
    <hr>
<% end %>

<% if params[:query] == "" %>
    <!--<p>You should enter a search term.</p>
    <hr>-->
<% end %>

<% if params[:query] != "" %>

<% if searchresults2.length != 0 %>


  <% i = 0 %>
	<% for tag in searchresults2 %>
    
    <% for entry in elist %>
      <% for t in entry.tags %>
        <% if t.tag == tag.tag %>
          <% if i == 0 %>
            Related Tags:  
            <p align=center><%= link_to h(tag.tag), entry_tag_url(entry,tag) %></p>
            <% i = 1 %> <!-- only one tag will be printed -->
          <% end %>
        <% end %>
      <% end %>
    <% end %>
  <% end %>
  <% if searchresults.length == 0 %>
   <hr>
  <% end %>
<% end %>

<!--######################################################################-->

<% if searchresults.length != 0 %>

Related Entries:
<p align=center>	
	<% for entry in searchresults %>
      <%= render :partial => "entries/entrybox", :locals => { :entry => entry } %>
  <% end %>
</p>
<hr>
<% end %>

<% end %>
